setUserVisibleHint

open fun setUserVisibleHint(isVisibleToUser: Boolean)(source)

Deprecated

If you are manually calling this method, use setMaxLifecycle instead. If overriding this method, behavior implemented when passing in true should be moved to onResume, and behavior implemented when passing in false should be moved to onPause.

Set a hint to the system about whether this fragment's UI is currently visible to the user. This hint defaults to true and is persistent across fragment instance state save and restore.

An app may set this to false to indicate that the fragment's UI is scrolled out of visibility or is otherwise not directly visible to the user. This may be used by the system to prioritize operations such as fragment lifecycle updates or loader ordering behavior.

Note: This method may be called outside of the fragment lifecycle. and thus has no ordering guarantees with regard to fragment lifecycle method calls.

Parameters

isVisibleToUser

true if this fragment's UI is currently visible to the user (default), false if it is not.